package com.company.project.learning.zaluan;

import org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayDeque;
import java.util.Queue;

/**
 * @Author: zhaoqi
 * @Date: 11/7/2019 7:03 PM
 * @Version 1.0
 */

public class FinallyTest1 {

    public static void main(String[] args) {

        //AbstractAutoProxyCreator
        Queue queue = new ArrayDeque();
        queue.add(1);
        queue.add(2);
        System.out.println(queue);
        queue.remove(1);
        System.out.println(queue);

        //System.out.println(test1());
    }
    //@Transactional(Propagation.)
    public static int test1() {
        int b = 20;
        try {
            System.out.println("try block");
            return b += 80;
        } catch (Exception e) {
            System.out.println("catch block"
            );
        } finally {
            System.out.println("finally block");
            if(b > 25) {
                System.out.println("b>25, b = " + b);
            }
        }
        return b;
    }
}
